/**
 * Copyright &copy; 2015-2020 <a href="http://www.easyhis.com/">easyhis</a> All rights reserved.
 */
package com.easy.dfcshop.entity;

import com.easy.common.utils.excel.annotation.ExcelField;
import com.easy.core.persistence.DataEntity;
import com.easy.modules.sys.entity.User;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 商品评价Entity
 * @author waylen chi
 * @version 2018-01-17
 */
public class ProductEvaluate extends DataEntity<ProductEvaluate> {
	
	private static final long serialVersionUID = 1L;
	private Integer evaId;		// eva_id
	private Integer productId;		// 商品id
	private User user;		// 用户内部ID
	private Date evaDate;		// 评价日期
	private String evaContent;		// 评价文字
	private String evaStar;		// 评价星级（1-5）
	private Integer orderId;		// 对应订单ID
	private String bshare;		// 是否分享（默认0）
	
	public ProductEvaluate() {
		super();
	}

	@NotNull(message="eva_id不能为空")
	@ExcelField(title="eva_id", align=2, sort=0)
	public Integer getEvaId() {
		return evaId;
	}

	public void setEvaId(Integer evaId) {
		this.evaId = evaId;
	}
	
	@ExcelField(title="商品id", align=2, sort=1)
	public Integer getProductId() {
		return productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}
	
	@ExcelField(title="用户内部ID", fieldType=User.class, value="user.userName", align=2, sort=2)
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="评价日期不能为空")
	@ExcelField(title="评价日期", align=2, sort=3)
	public Date getEvaDate() {
		return evaDate;
	}

	public void setEvaDate(Date evaDate) {
		this.evaDate = evaDate;
	}
	
	@ExcelField(title="评价文字", align=2, sort=4)
	public String getEvaContent() {
		return evaContent;
	}

	public void setEvaContent(String evaContent) {
		this.evaContent = evaContent;
	}
	
	@ExcelField(title="评价星级（1-5）", align=2, sort=5)
	public String getEvaStar() {
		return evaStar;
	}

	public void setEvaStar(String evaStar) {
		this.evaStar = evaStar;
	}
	
	@ExcelField(title="对应订单ID", align=2, sort=6)
	public Integer getOrderId() {
		return orderId;
	}

	public void setOrderId(Integer orderId) {
		this.orderId = orderId;
	}
	
	@ExcelField(title="是否分享（默认0）", align=2, sort=7)
	public String getBshare() {
		return bshare;
	}

	public void setBshare(String bshare) {
		this.bshare = bshare;
	}
	
}